import { http } from '@/utils/http'
interface IMapPage {
  current: number
  size: number
}
// 获取设施分类
/* 
返回值"data": {
        "records": [
            {
                "id": 1,
                "name": "路灯",
                "deptId": 1
            },....
        ],
        "total": 1,
        "size": 10,
        "current": 1,
        "pages": 1
    }
*/
export const getFacilityCategories = (params: IMapPage) => {
  return http.get('/api/facility/categories', { params })
}

// 获取设施列表
/* 
    "data": [
        {
            "id": 1,
            "name": "1号路灯",
            "categoryId": 1,// 设施分类id
            "address": "湖北汽车工业学院正门",// 地址
            "longitude": 114.34343,// 经度
            "latitude": 29.831157,// 纬度
            "status": 1// '状态：1正常，2维修中'
        },....
    ]
*/
export const getFacilityList = () => {
  return http.get('/api/facility/map')
}
